package com.twu.biblioteca;

/**
 * Created by kashyapk on 05/03/14.
 */
public class MainMenu extends Menu{

    public MainMenu(Library library, Customer customer) {
        super(library, customer);
    }

    public void ShowMenu() {
        String menu = "1.Books  2.Movie  3.User Information \nEnter you choice: ";
        System.out.print(menu);
    }

    public int MenuAction(int choice) {
        Menu menu;
        switch(choice) {
            case 1:
                menu = new BookMenu(library, customer);
                menu.ShowMenu();
                menu.MenuAction(MenuSelect());
                break;
            case 2:
                menu = new MovieMenu(library, customer);
                menu.ShowMenu();
                menu.MenuAction(MenuSelect());
                break;
            case 3:
                System.out.println("Name: " + customer.getName() + "\nEmail: " + customer.getEmail() + "\nPhone: " + customer.getPhone());
                break;
            default:
                System.out.println("Select a valid option!");
        }
        return choice;
    }

}
